from django.conf.urls import url
from . import views
from django.contrib.auth.decorators import login_required
urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.CheckUsernameView.as_view()),
    url(r'^mobiles/(?P<phone>1[345789]\d{9})/count/$', views.CheckPhoneView.as_view()),
    url(r'^login/$', views.LoginUserView.as_view()),
    url(r'^logout/$', views.LogoutUserView.as_view()),
    # url(r'^usercenter/$', login_required(views.UserCenterView.as_view())),
    url(r'^usercenter/$', views.UserCenterView.as_view()),
    url(r'^emails/$', views.EmailSendView.as_view()),
    url(r'^emails/verification/$', views.EmailActiveView.as_view()),
    url(r'^addresses/$', views.AddressesView.as_view()),
    url(r'^addresses/create/$', views.AddressesCreateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/$', views.AddressesUpdateView.as_view()),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.AddressesDefaultView.as_view()),

]
